package com.mcay.easyexcel.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.mcay.easyexcel.converters.CustomStringStringWriteConverter;
import lombok.Data;

import java.util.Date;

/**
 * 学生实体
 * Created by  longHe
 * 2021/8/19 11:00
 */
@Data
public class Student {

    @ExcelIgnore
    private String id;

    //@ExcelProperty(value = "姓名", index = 0)
    @ExcelProperty(value = {"学生信息", "姓名"}, converter = CustomStringStringWriteConverter.class)  //字符串起前面加上"自定义："三个字
    private String name;

    //@ExcelProperty(value = "年龄", index = 1)
    @ExcelProperty(value = {"学生信息","年龄"} )
    private Integer age;

    //@ExcelProperty(value = "性别", index = 2)
    @ExcelProperty(value = {"学生信息", "性别"})
    private String sex;

    //@ExcelProperty(value = "出生", index = 3)
    @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒")//自定义时间格式
    @ExcelProperty(value = {"学生信息", "出生"})
    private Date birthday;

    //@ExcelProperty(value = "班级", index = 4)
    @ExcelProperty(value = {"班级信息", "班级"})
    private String clazz;

    //@ExcelProperty(value = "胜率", index = 5)
    @NumberFormat("#.##%")//用百分比输出
    @ExcelProperty(value = {"比赛信息", "胜率"})
    private Double sl;

    //@ExcelProperty(value = "学校", index = 6)
    @ExcelProperty(value = {"学校信息", "学校"})
    private String school;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x1;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x2;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x3;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x4;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x5;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x6;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x7;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x8;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x9;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x10;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x11;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x12;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x13;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x14;

    @ExcelProperty(value = {"其他信息", "其他"})
    private String x15;

    public Student() {}


    public Student(String name, Integer age, String sex, Date birthday, String clazz, Double sl, String school) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.birthday = birthday;
        this.clazz = clazz;
        this.sl = sl;
        this.school = school;
    }
}